<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="assets/js/uploadify/uploadifive.css"/>
</head>
<body>
	<form id="form_uploat">
		学生名称：<input name="stuName"/><br/>
		学生图像：<input type="file" id="stu_File"/><br/>
		<input type="hidden" name="stuAvatar" id="stuAvatar"/>
		<input type="submit" value="提交"/>
	</form>
</body>
<script type="text/javascript" src="assets/js/jquery/jquery-3.4.1.js"></script>
<script type="text/javascript" src="assets/js/uploadify/jquery.uploadifive.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		//绑定ajax上传文件功能
		$('#stu_File').uploadifive({
			'auto'             : true,//是否自动上传
			'fileObjName'	   :'stuFile',//上传的二进制数据的名称
			'fileType'         : 'image/*',//上传文件的类型 image/png,image/jpg,image/gif
			'uploadScript'     : 'upload2',//上传的URL
 			'onUploadComplete' : function(file, data) {//上传成功后的回调
				console.log(data); 
 				$('#stuAvatar').val(data);
			},
		});
	});
</script>
</html>